Skip to content

fix(lcms): stop plain MS jcamp from being detected as Chemstation LC/MS - #322

Open
headri wants to merge 2 commits into
masterfrom
618-v4-a-plain-raw-ms-file-is-rendered-with-the-lcms-layout-in-the-spectra-editor
Open

fix(lcms): stop plain MS jcamp from being detected as Chemstation LC/MS#322
headri wants to merge 2 commits into
masterfrom
618-v4-a-plain-raw-ms-file-is-rendered-with-the-lcms-layout-in-the-spectra-editor

Conversation

@headri

@headri headri commented Aug 20, 2026

Copy link
Copy Markdown

A plain chem-spectra-generated MS export carries a MASS SPECTRUM root DATA TYPE that isChemstationLcms mistook for a genuine Chemstation LC/MS file. Bail out early on signatures unique to the plain export (SPECTRUM category, ##$CSSCANAUTOTARGET, the M/Z units triplet, or ##NTUPLES = MASS SPECTRUM), and tighten the remaining heuristic to require TIC/UVVIS category or multi-page metadata.

A plain chem-spectra-generated MS export carries a MASS SPECTRUM root
DATA TYPE that isChemstationLcms mistook for a genuine Chemstation
LC/MS file. Bail out early on signatures unique to the plain export
(SPECTRUM category, ##$CSSCANAUTOTARGET, the M/Z units triplet, or
##NTUPLES = MASS SPECTRUM), and tighten the remaining heuristic to
require TIC/UVVIS category or multi-page metadata.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@headri
headri requested a review from PiTrem August 20, 2026 11:28
…veto

The prior fix's early-return blacklist (SPECTRUM category, ##$CSSCANAUTOTARGET,
##NTUPLES=MASS SPECTRUM) ran before all positive LC/MS evidence, so it could
override a genuine Chemstation export, and it relied on $CSCATEGORY parsing
that silently dropped single (non-array) values. Its added
(hasMultipleSpectra && hasPageMetadata) clause was also self-defeating: the
original plain-MS fixture has multi-page structure too, so that clause alone
reclassified it as LC/MS again.

Fix the array-vs-string $CSCATEGORY read, drop the blanket blacklist, and
narrow the veto to the one genuinely ambiguous case (multi-page MASS SPECTRUM
root with no other chromatographic hint), gated only on the MS-specific units
triplet and placed after all positive-evidence branches so it can never
override them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant